##effect sizes study 2



group_2b <- dplyr::recode(group_2, "2"="Control", "1"="Boy ", "3"="Girl")


vars <- c("Independence", "Obedience", "Curiosity", "Considerate")

table(CFAdata_2$treatment2)
##effect size of control vs boy
CFAdata_2b<-subset(CFAdata_2, treatment2==1|treatment2==2)

irt_data_2b <- subset(CFAdata_2b, select = vars)

group_2b<-as.character(CFAdata_2b$treatment2 )
group_2b <- dplyr::recode(group_2b, "2"="Control", "1"="Boy ", "3"="Girl")

mod_configural_2b<-multipleGroup( data=irt_data_2b, 
                                  model=1, 
                                  group= group_2b ) 

empirical_ES(mod_configural_2b)
empirical_ES(mod_configural_2b, DIF=FALSE)




##effect size of control vs girl
CFAdata_2g<-subset(CFAdata_2, treatment2==3|treatment2==2)

irt_data_2g <- subset(CFAdata_2g, select = vars)

group_2g<-as.character(CFAdata_2g$treatment2 )

table(group_2g)
group_2g <- dplyr::recode(group_2g, "2"="Control", "1"="Boy ", "3"="Girl")

mod_configural_2g<-multipleGroup( data=irt_data_2g, 
                                  model=1, 
                                  group= group_2g ) 

empirical_ES(mod_configural_2g)
empirical_ES(mod_configural_2g, DIF=FALSE)




